<style lang="less">
@import "./login.less";
</style>
<template>
  <div
    :style="
      'width:' +
      screenWidth +
      'px;height:' +
      screenHeight +
      'px; overflow-y: auto;'
    "
  >
    <div class="container">
      <Header :Current="4" @CurrentSelection="CurrentSelection"></Header>
      <guoziranAdvantages
        v-show="CurrentNum == 3"
        :url="require('@/assets/images/guoziran.png')"
      ></guoziranAdvantages>
      <guozirantable
        v-show="CurrentNum == 3"
        @setDetailsid="changeDetailsid"
      ></guozirantable>
      <div>
        <Footer @ContactUs="ContactUs"></Footer>
      </div>
    </div>
    <Spin size="large" fix v-if="isLoading"></Spin>
  </div>
</template>
<script>
import axios from "axios";
let moment = require("moment");
import util from "../libs/util";
import { Base64 } from "js-base64";
import Header from "@/componets/Header.vue";
import womendeyoushiAdvantages from "@/componets/womendeyoushiAdvantages.vue";
import keyanAdvantages from "@/componets/keyanAdvantages.vue";
import haiwaiyouqing from "@/componets/haiwaiyouqing.vue";
import rencaiAdvantages from "@/componets/rencaiAdvantages.vue";
import guoziranAdvantages from "@/componets/guoziranAdvantages.vue";
import PPTAdvantages from "@/componets/PPTAdvantages.vue";
import keyanshujuAdvantages from "@/componets/keyanshujuAdvantages.vue";
import guozirantable from "@/componets/guozirantable.vue";
import yewufanwei from "@/componets/yewufanwei.vue";
import fuwuliucheng from "@/componets/fuwuliucheng.vue";
import Footer from "@/componets/Footer.vue";
import tabstable from "@/componets/tabstable.vue";
import keyanshuju from "@/componets/keyanshuju.vue";
import Listdetails from "@/componets/Listdetails.vue";
import tabsJT from "@/componets/tabsJT.vue";
import companyprofile from "@/componets/companyprofile.vue";
import detailspage from "@/componets/detailspage.vue";
export default {
  name: "GoodsList",
  // beforeRouteEnter(to, from, next) {
  //   window.scrollTo(0, 0);
  //   next();
  // },
  components: {
    Header,
    womendeyoushiAdvantages,
    keyanAdvantages,
    haiwaiyouqing,
    rencaiAdvantages,
    guoziranAdvantages,
    PPTAdvantages,
    keyanshujuAdvantages,
    yewufanwei,
    fuwuliucheng,
    Footer,
    tabstable,
    guozirantable,
    keyanshuju,
    Listdetails,
    tabsJT,
    companyprofile,
    detailspage,
  },
  data() {
    return {
      showSaoMA: false,
      showcallme: false,
      rencaixiangmuList: [],
      rencaixiangmuParams: {
        articleType: 0,
        pageNum: 1,
        pageSize: 10,
      },
      newdataList: [],
      keyandataList: [],
      getDetailsid: -1,
      showdetailspage: false,
      overNum: 0,
      CurrentNum: 3,
      isLoading: false,
      orderGoodsList: {},
      screenWidth: 0,
      screenHeight: 0,
      boxList12: [
        {
          name: "两院院士",
        },
        {
          name: "国家杰青",
        },
        {
          name: "万人领军",
        },
        {
          name: "长江学者",
        },
        {
          name: "海外优青",
        },
        {
          name: "省市杰青",
        },
        {
          name: "国家优青",
        },
        {
          name: "省市优青",
        },
        {
          name: "青年长江",
        },
        {
          name: "校级人才",
        },
        {
          name: "青年拔尖",
        },
        {
          name: "其他人才",
        },
      ],
    };
  },
  computed: {},
  methods: {
    getshenqingzhengcezixunFun() {
      let data = {
        articleType: "3",
        typeo: "3_1",
        pageNum: 1,
        pageSize: 10,
      };
      axios.post(`/textcontent/search`, data).then((res) => {
        let { code, message, result } = res;
        if (code == "ok") {
          this.newdataList = result.data.map((item) => {
            item.createdTime;
            return item;
          });
        } else {
        }
      });
    },
    callme() {
      this.showcallme = !this.showcallme;
    },
    ContactUs(e) {
      this.CurrentNum = e;
    },
    getExampleList() {
      let data = {
        articleTypeList: ["0", "1", "3"],
        // typeoList: ["0", "1", "3"],
        // typetList: ["0", "1", "3"],
        pageNum: 1,
        pageSize: 10,
      };
      axios.post(`/textcontent/search`, data).then((res) => {
        let { code, message, result } = res;
        if (code == "ok") {
          this.newdataList = result.data.map((item) => {
            item.createdTime;
            return item;
          });
        } else {
        }
      });
    },
    getkeyandataList() {
      let data = {
        articleType: 2,
        pageNum: 1,
        pageSize: 10,
      };
      axios.post(`/textcontent/search`, data).then((res) => {
        let { code, message, result } = res;
        if (code == "ok") {
          this.keyandataList = result.data.map((item) => {
            item.createdTime;
            return item;
          });
        } else {
        }
      });
    },
    changeDetailsid(e) {
      console.log("埋没的人才", e);
      this.getDetailsid = e;
      this.showdetailspage = false;
      this.CurrentNum = 13;
      this.showdetailspage = true;
    },
    overnow(index) {
      this.overNum = index;
    },
    CurrentSelection(index, value) {
      this.CurrentNum = index;
      if (value == undefined) {
        value = index;
      }
      switch (value) {
        case 0:
          this.$router.push({
            name: "home",
          });
          break;
        case 1:
          this.$router.push({
            name: "OverseasOutstandingYouth",
          });
          break;
        case 2:
          this.$router.push({
            name: "TalentProject",
          });
          break;
        case 3:
          this.$router.push({
            name: "NationalNatural",
          });
          break;
        case 4:
          this.$router.push({
            name: "ScientificResearchDrawings",
          });
          break;
        case 5:
          this.$router.push({
            name: "ppt",
          });
          break;
        case 6:
          this.$router.push({
            name: "ResearchInformation",
          });
          break;
        case 8:
          this.$router.push({
            name: "searchInput",
          });
          break;
        case 20:
          this.$router.push({
            name: "ThesisGuidance",
          });
          break;
        default:
          break;
      }
    },
    // rencaixiangmuFUN() {
    //   axios
    //     .post(`/textcontent/search`, this.rencaixiangmuParams)
    //     .then((res) => {
    //       let { code, message, result } = res;
    //       if (code == "ok") {
    //         this.rencaixiangmuList = result.data.map((item) => {
    //           item.createdTime;
    //           return item;
    //         });
    //       } else {
    //       }
    //     });
    // },
    updateScreenSize() {
      this.screenWidth = window.innerWidth;
      this.screenHeight = window.innerHeight;
    },
  },
  created() {},
  mounted() {
    this.updateScreenSize();
    window.addEventListener("resize", this.updateScreenSize);
    this.getExampleList();
    this.getkeyandataList();
    this.getshenqingzhengcezixunFun();
  },
  beforeDestroy() {
    window.removeEventListener("resize", this.updateScreenSize);
  },
};
</script>

<style  scoped>
.container {
  margin: 0 auto;
  /* position: relative; */
  min-width: 1920px;
}
